
#include "exprfactory.h"

ExprFactory::ExprFactory()
{

}

Operation * ExprFactory::createOperation(char c_oper)
{
    Operation * oper;
    switch (c_oper) {
    case '+':
        oper = new AddOperation();
        break;
    case '-':
        oper = new SubOperation();
        break;
    case '*':
        oper = new MulOperation();
        break;
    case '/':
        oper = new DivOperation();
        break;
    default:
        oper = nullptr;
        break;
    }
    return oper;
}
